package state.group.events;

import messages.ByteList;
import messages.MessageUtils;

public abstract class BaseEvent {
    
    public BaseEvent(byte[] data, int startIndex)
    {
        
    }
    
    public BaseEvent()
    {
        //NOOP
    }
    
    public abstract int getEventByteLength();
    
    public void appendToByteList(ByteList list)
    {
        list.addByte(getEventType().getIdentifier());
    }
    
    public abstract EventType getEventType();
    
    @Override
    public String toString()
    {
        ByteList b = new ByteList();
        appendToByteList(b);
        
        return MessageUtils.byteArrayToString(b.toByteArray());
    }

}
